package view;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JCheckBox;

import javax.swing.JFrame;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class Rules extends JFrame {
	private JButton okButton;
	private AbstractAction okButtonAction;
	private JCheckBox allowPush;
	private JCheckBox allowEnterGoalEasy;
	private JCheckBox allowMathProb;

	public Rules() {
		initGUI();
		setVisible(true);
		setLocationRelativeTo(null);
	}

	private void initGUI() {
		try {
			{
				getContentPane().setLayout(null);
				this.setPreferredSize(new java.awt.Dimension(400, 400));
				this.setTitle("Set Game Rules");
				this.setResizable(false);
				{
					okButton = new JButton();
					getContentPane().add(okButton);
					getContentPane().add(getAllowPush());
					getContentPane().add(getAllowMathProb());
					getContentPane().add(getAllowEnterGoalEasy());
					okButton.setBounds(313, 318, 55, 35);
					okButton.setAutoscrolls(true);
					okButton.setAction(getOkButtonAction());
					okButton.setText("OK");
				}
				this.setSize(400, 400);
			}
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	private AbstractAction getOkButtonAction() {
		if(okButtonAction == null) {
			okButtonAction = new AbstractAction("OK", null) {
				public void actionPerformed(ActionEvent evt) {
					dispose();
				}
			};
		}
		return okButtonAction;
	}
	
	private JCheckBox getAllowPush() {
		if(allowPush == null) {
			allowPush = new JCheckBox();
			allowPush.setText("Allow Push");
			allowPush.setBounds(12, 25, 101, 20);
			allowPush.setToolTipText("Allows you to push a foe's player piece back to his/her home.");
		}
		return allowPush;
	}
	
	private JCheckBox getAllowMathProb() {
		if(allowMathProb == null) {
			allowMathProb = new JCheckBox();
			allowMathProb.setText("Include Math Exercises");
			allowMathProb.setBounds(12, 54, 173, 20);
		}
		return allowMathProb;
	}
	
	private JCheckBox getAllowEnterGoalEasy() {
		if(allowEnterGoalEasy == null) {
			allowEnterGoalEasy = new JCheckBox();
			allowEnterGoalEasy.setText("Enter Goal Easily");
			allowEnterGoalEasy.setBounds(12, 83, 135, 20);
			allowEnterGoalEasy.setToolTipText("With this setting checked, you can enter the goal eventhough you might get a die value taking you to far.");
		}
		return allowEnterGoalEasy;
	}

}
